package GUI;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.JEditorPane;
import javax.swing.JTextPane;
import javax.swing.JButton;
import javax.swing.JTextField;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.BoxLayout;
import javax.swing.JTextArea;
import javax.swing.JLabel;
import java.awt.Choice;
import java.awt.Label;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import java.awt.Button;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFormattedTextField;

public class Login extends JFrame {
	private JTextField textField;
	public String text_ip,text_host;
	public int flag=-1;
	private JTextField textField_1;
	

	public Login() {
		setAlwaysOnTop(true);
		getContentPane().setLayout(null);
		
		textField = new JTextField();
		textField.setBounds(204, 55, 114, 21);
		getContentPane().add(textField);
		textField.setColumns(10);
		
		JButton btnCancel = new JButton("CANCEL");
		btnCancel.setBounds(245, 151, 98, 27);
		getContentPane().add(btnCancel);
		
		JButton btnOk = new JButton("OK");
		this.setVisible(true);
	//	this.pack();
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		
		btnOk.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				if(e.getSource()=="CANCEL")
					flag=0;
				else
					flag=1;
				text_ip=textField.getText();
				text_host=textField_1.getText();
			}
		});
		btnOk.setBounds(107, 151, 98, 27);
		getContentPane().add(btnOk);
		
		JLabel lblWelcomToThe = new JLabel("welcom to the system");
		lblWelcomToThe.setBounds(111, 12, 185, 17);
		getContentPane().add(lblWelcomToThe);
		
		JLabel lblEnterIpAdress = new JLabel(" ENTER IP ADRESS");
		lblEnterIpAdress.setBounds(12, 57, 114, 17);
		getContentPane().add(lblEnterIpAdress);
		
		JLabel lblEnterNumberHostdefult = new JLabel("ENTER NUMBER HOST(defult 0)");
		lblEnterNumberHostdefult.setBounds(12, 98, 196, 17);
		getContentPane().add(lblEnterNumberHostdefult);
		
		textField_1 = new JTextField();
		textField_1.setBounds(204, 96, 114, 21);
		getContentPane().add(textField_1);
		textField_1.setColumns(10);
		
		
	}
	
	
	public void exit()
	{
		this.setVisible(false);
	}
}
